<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %> 
<c:choose>
	<c:when test="${empty errorMsg }">
<script type="text/javascript">
function bal_check_list_trclick(code,type,user){
	var btnCheck = $("#bal_check_list_btn_check",navTab.getCurrentPanel());
	btnCheck.attr("title","["+code+"]-["+type+"结算]-["+user+"]");
}
</script>
<form id="pagerForm" method="post" action="bal_checkList.action"  onsubmit="return divSearch(this, 'bal_check_list');">
	<input type="hidden" name="pageNum" value="${currentPage }" /> 
	<input type="hidden" name="numPerPage" value="${numPerPage}" /> 
</form>
	<div class="panelBar">
		<ul class="toolBar">
			<li><a id="bal_check_list_btn_check" class="look" 
					href="{bal_check_list_action}"  
					rel="bal_check_dialog" 
					target="dialog"
					mask="true"
					max="true"
					title="">
					<span>单据审批</span>
				</a>
			</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="120" rel="bal_check_list">
		<thead>
			<tr>
				<th align="center">序号</th>
				<th>结算编号</th>
				<th>结算类型</th>
				<th>申请人</th>
				<th>申请金额</th>
				<th>申请日期</th>
				<!-- 
				<th>批复人</th>
				<th>批复日期</th>
				<th>批复金额</th>
				<th>签批人</th>
				<th>签批日期</th>
				<th>单据状态</th>
				<th>打印标识</th>
				 -->
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${recordList}" var="bal" varStatus="status">
				<tr target="bal_check_list_action" rel="bal_<c:choose>
					<c:when test="${bal.balType==6 }">
						showBuMgrCheck
					</c:when>
					<c:when test="${bal.balType==5 }">
						showCustMgrCheck
					</c:when>
					<c:when test="${bal.balType==4 }">
						showCashCheck
					</c:when>
					<c:when test="${bal.balType==3 }">
						showTelfeeCheck
					</c:when>
				</c:choose>.action?billCode=${bal.billCode}" 
				onclick="javascript:bal_check_list_trclick('${bal.billCode}','${application.balTypeMap[bal.balType]}',
				'<c:forEach var="sale" items="${saleList}"><c:if test="${sale.isuId == bal.appUserId }">${sale.isuName}</c:if></c:forEach>')"
				>
				
				<td>${(status.index+1) + (currentPage-1) * numPerPage}</td>
				<td>${bal.billCode}</td>
				<td>${application.balTypeMap[bal.balType]}</td>
				<td>
					<c:forEach var="sale" items="${saleList}">
	 					<c:if test="${sale.isuId == bal.appUserId }">
							${sale.isuName}
						</c:if>
					</c:forEach>
				</td>
				<td>
					<fmt:formatNumber value="${bal.appFee}" type="number" pattern="￥0.00" />
				</td>
				<td>
					<fmt:parseDate  value="${bal.appDate}" var="appDate" pattern="yyyyMMddHHmmss"/>  
					<fmt:formatDate value="${appDate}" pattern="yyyy-MM-dd HH:mm:ss" /> 
				</td>
				<!-- 
				<td>
					<c:forEach var="sale" items="${saleList}">
	 					<c:if test="${sale.isuId == bal.chkUserId }">
							${sale.isuName}
						</c:if>
					</c:forEach>
				</td>
				<td>
					<fmt:parseDate  value="${bal.chkDate}" var="chkDate" pattern="yyyyMMddHHmmss"/>  
					<fmt:formatDate value="${chkDate}" pattern="yyyy-MM-dd HH:mm:ss" /> 
				</td>
				<td>
					<fmt:formatNumber value="${bal.chkFee}" type="number" pattern="￥0.00" />
				</td>
				<td>
					<c:forEach var="sale" items="${saleList}">
	 					<c:if test="${sale.isuId == bal.makUserId }">
							${sale.isuName}
						</c:if>
					</c:forEach>
				</td>
				<td>
					<fmt:parseDate  value="${bal.makDate}" var="makDate" pattern="yyyyMMddHHmmss"/>  
					<fmt:formatDate value="${makDate}" pattern="yyyy-MM-dd HH:mm:ss" /> 
				</td>
				<td>
					<c:choose>
						<c:when test="${bal.billState==1}">新申请</c:when>
						<c:when test="${bal.billState==2}">已批复</c:when>
						<c:when test="${bal.billState==3}">已签批</c:when>
					</c:choose>
				</td>
				<td><c:choose>
						<c:when test="${bal.pntFlag==0}">未打印</c:when>
						<c:when test="${bal.pntFlag==1}">已打印</c:when>
					</c:choose>
				</td> -->
			</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>页次&nbsp;${currentPage }&nbsp;/&nbsp;${pageCount }&nbsp;页，</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value}, 'bal_check_list')">
				<option ${numPerPage==20?"selected":"" }  value="20">20</option>
				<option ${numPerPage==50?"selected":"" }  value="50">50</option>
			</select>
			<span>条，共${recordCount}条</span>
		</div>
		<div class="pagination" 
			rel="bal_check_list" 
			totalCount="${recordCount}"
			numPerPage="${pageSize}" 
			pageNumShown="${pageNumShown}"
			currentPage="${currentPage }">
		</div>
	</div>
</c:when>
	<c:otherwise>
		<div style="padding: 5px;color: red;">页面加载错误！${errorMsg }</div>
	</c:otherwise>
</c:choose>